class AppConfig:
    def __init__(self, app) -> None:
        self.app = app
        
        # flask返回静态文件 引入js报错问题 text/plain
        from mimetypes import add_type
        add_type('application/javascript', '.js', True)

        # 配置 session key
        app.secret_key = '@@@@####$$$$%%%%^^^^&&&&'

        # 初始化定时任务
        from blueprints.admin.time_tasks import scheduler,start_init
        scheduler.init_app(app)
        scheduler.start()
        # 允许scheduler 给app应用添加任务api...
        app.config['SCHEDULER_API_ENABLED'] = True 

        # 将数据库的任务一一开启
        start_init()

        # 跨域
        from flask_cors import CORS
        CORS(self.app)

        # 蓝图
        from blueprints import admin, front
        self.app.register_blueprint(front.bp)
        self.app.register_blueprint(admin.bp)
